#include <iostream>
#include <vector>
#include <unordered_set>
#include <algorithm>
#include <queue>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<vector<int>> hash;
    while (n--)
    {
        vector<int> arr(256);
        string str;
        cin >> str;
        for (auto s : str)
        {
            arr[s]++;
        }
        int k = hash.size();
        if (k == 0)
        {
            hash.push_back(arr);
        }
        int d = 0;
        for (int i = 0; i < k; i++)
        {
            for (int j = 0; j < 256; j++)
            {
                if (hash[i][j] != arr[j])
                {
                    d++;
                    break;
                }
            }
            if (d == k)
            {
                hash.push_back(arr);
                break;
            }
        }
    }
    cout << hash.size() << endl;
    return 0;
}

int main() {
    int n;
    cin >> n;
    string str;
    unordered_set<string> hash;
    while (n--)
    {
        cin >> str;
        sort(str.begin(), str.end());
        hash.insert(str);
    }
    cout << hash.size() << endl;
    return 0;
}

int main() {
    int n;
    cin >> n;
    vector<vector<int>> hash;
    while (n--)
    {
        vector<int> arr(256);
        string str;
        cin >> str;
        for (auto s : str)
        {
            arr[s]++;
        }
        int k = hash.size();
        if (k == 0)
        {
            hash.push_back(arr);
        }
        for (int i = 0; i < k; i++)
        {
            int d = 0;
            for (int j = 0; j < 256; j++)
            {
                if (hash[i][j] != arr[j])
                {
                    hash.push_back(arr);
                    d = 1;
                    break;
                }
            }
            if (d == 1)
            {
                break;
            }
        }
    }
    cout << hash.size() << endl;
    return 0;
}

int main() {
    int n;
    cin >> n;
    int a, b, c, d;
    int ret = 0;
    while (n--)
    {
        cin >> a >> b >> c >> d;
        if (b > c)
        {
            cout << -1 << endl;
        }
        else
        {
            ret = 0;
            while (a > 0)
            {
                int k = c;
                while (a > 0 && k > 0)
                {
                    k -= b;
                    if (k <= 0)
                    {
                        ret++;
                        break;
                    }
                    a -= d;
                }
            }
            cout << ret << endl;
        }
    }
    return 0;
}

#include <iostream>
using namespace std;

int main() {
    int n;
    cin >> n;
    int a, b, c, d;
    int ret = 0;
    while (n--)
    {
        cin >> a >> b >> c >> d;
        if (b >= c)
        {
            cout << -1 << endl;
        }
        else
        {
            ret = 0;
            int k = c;
            int j = a;
            while (k > 0)
            {
                k -= b;
                if (k <= 0)
                {
                    break;
                }
                j -= d;
            }
            int q = a - j;
            if (q == 0)
            {
                cout << 1 << endl;
            }
            else
            {
                ret = a / q;
                if (a % q == 0)
                {
                    ret -= 1;
                }
                cout << ret << endl;
            }
        }
    }
    return 0;
}

class Solution {
public:

    int dx[4] = { 0,0,1,-1 };
    int dy[4] = { 1,-1,0,0 };
    bool board[201][201] = { 0 };

    void insert(vector<vector<int> >& m, int x, int y, int x1, int y1)
    {
        board[x1][y1] = 1;
        for (int i = 0; i < 4; i++)
        {
            if (x1 + dx[i] >= 0 && x1 + dx[i] < x && y1 + dy[i] >= 0 && y1 + dy[i] < y && m[x1 + dx[i]][y1 + dy[i]] && !board[x1 + dx[i]][y1 + dy[i]])
            {
                insert(m, x, y, x1 + dx[i], y1 + dy[i]);
            }
        }
    }

    int citys(vector<vector<int> >& m) {
        // write code here
        int x = m.size();
        int y = m[0].size();
        queue<pair<int, int>> q;
        for (int i = 0; i < x; i++)
        {
            for (int j = 0; j < y; j++)
            {
                if (m[i][j] == 1)
                {
                    q.push(pair<int, int>(i, j));
                }
            }
        }
        int ret = 0;
        while (!q.empty())
        {
            int x1 = q.front().first;
            int y1 = q.front().second;
            q.pop();
            if (board[x1][y1] == 0)
            {
                ret++;
            }
            insert(m, x, y, x1, y1);
        }
        return ret;
    }
};

class Solution {
public:
    bool board[201] = { 0 };

    void dfs(vector<vector<int> >& m, int i)
    {
        board[i] = 1;
        for (int j = 0; j < m[0].size(); j++)
        {
            if (!board[j] && m[i][j])
            {
                dfs(m, j);
            }
        }
    }

    int citys(vector<vector<int> >& m) {
        // write code here
        int n = m.size();
        int ret = 0;
        for (int i = 0; i < n; i++)
        {
            if (!board[i])
            {
                ret++;
                dfs(m, i);
            }
        }
        return ret;
    }
};